package com.conseilimmo.repository;

import com.hildeberto.home.util.EntityManagerHelper;
import java.util.List;
import javax.persistence.EntityManager;
import objetsBd.IndexBd;

/**
 *
 * @author verpoorten
 */
public class IndexBsn {
     private EntityManager em = EntityManagerHelper.EM.open();
         public List<IndexBd> trouverListeLocations() {
        String sql = "select b from IndexBd  b";
        return em.createQuery(sql).getResultList();
    }

    public IndexBd trouverLocationParId(Long idIndex) {
        String sql = "select b from LocationBd  b";
        sql += " where b.idIndex = :idIndex";
        return (IndexBd) em.createQuery(sql).setParameter("idIndex", idIndex).getSingleResult();
    }  
    
}
